package al.softsynergy.auk.data.containers;

import java.util.Collection;
import java.util.List;

import al.softsynergy.auk.data.ejbs.IAukBean;
import al.softsynergy.auk.data.entries.Ankesa;

import com.vaadin.data.util.BeanItemContainer;

public class AnkesaContainer  extends BeanItemContainer<Ankesa> {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2659833352480029135L;

	public static final Object[] NATURAL_COL_ORDER = new Object[]{"id","emri","mbiemri","adresa","tel", "ankesaLloj", "dataAnkese", "user", "pershkrimi"};
	
	public static final Object[] NATURAL_COL_ORDER_FOR_FORM = new Object[]{"emri","mbiemri","adresa","tel", "ankesaLloj", "dataAnkese", "pershkrimi"};
	/**
	 * "Human readable" captions for properties in same order as in
	 * NATURAL_COL_ORDER.
	 */
	public static final String[] COL_HEADERS_ALBANIAN = new String[]
		{"ID","Emri","Mbiemri","Adresa","Tel", "Lloji", "Data ankeses", "Perdoruesi", "Pershkrimi"};
	
	

	public AnkesaContainer() {
		super(Ankesa.class);
		// TODO Auto-generated constructor stub
	}

	public AnkesaContainer(Collection<Ankesa> collection)
			throws IllegalArgumentException {
		
		super(collection);
		// TODO Auto-generated constructor stub
	}
	
	
	
	public static AnkesaContainer createFromEjb(IAukBean aukBean){
		AnkesaContainer ankesaContainer;
		List<Ankesa> ankesaList = aukBean.queryAnkesa();
		
		if (ankesaList == null || ankesaList.size() == 0)
			ankesaContainer = new AnkesaContainer();
		else
			ankesaContainer = new AnkesaContainer(ankesaList);
		
		 return ankesaContainer;
	}


}
